oracle.hadoop.balancer.examples.invindx

## Class InvertedIndexMapreduce.InvertedIndexMapper

- java.lang.Object
- - org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue>
  - - oracle.hadoop.balancer.examples.invindx.InvertedIndexMapreduce.InvertedIndexMapper

- Enclosing class:
    InvertedIndexMapreduce

      public static class InvertedIndexMapreduce.InvertedIndexMapper
      extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue>

  Inverted Index mapper class for `TextInputFormat` and `FileSplit` This class uses the file name obtained from `FileSplit` as the location of the word, and the value of the LongWritable key of `TextInputFormat` as the offset of the word in that file.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper

      `org.apache.hadoop.mapreduce.Mapper.Context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvertedIndexMapreduce.InvertedIndexMapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `map(org.apache.hadoop.io.LongWritable keyIn, org.apache.hadoop.io.Text valueIn, org.apache.hadoop.mapreduce.Mapper.Context context)` The map function tokenizes each line in the input into words.
    `void` | `setup(org.apache.hadoop.mapreduce.Mapper.Context context)` Initialize the key and value

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Mapper

      `run`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InvertedIndexMapreduce.InvertedIndexMapper

          public InvertedIndexMapreduce.InvertedIndexMapper()

  - ### Method Detail

    - #### map

          public void map(org.apache.hadoop.io.LongWritable keyIn,
                 org.apache.hadoop.io.Text valueIn,
                 org.apache.hadoop.mapreduce.Mapper.Context context)
                   throws java.io.IOException,
                          java.lang.InterruptedException

      The map function tokenizes each line in the input into words. For each word, it outputs the word, its location (file name) and offset (offset within the file).
      Overrides:
        `map` in class `org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue>`
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`

    - #### setup

          public void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
                     throws java.io.IOException

      Initialize the key and value
      Overrides:
        `setup` in class `org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,InvertedIndex.InvertedIndexKey,InvertedIndex.InvertedIndexValue>`
      Throws:
        `java.io.IOException`

Copyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.